<script>
      function follow(th, id) {
        let url = ""
        let uid = id
        if ("{$base.isLog}") {
            $.get('/index/profile/doFollow', { uid: uid }, (res) => {
                if (res.code == 200) {
                    layer.msg(res.message, { icon: 6 })
                    var str =  $(th)[0].innerText
                    if (str.trim() == '+关注') {
                        $(th)[0].innerHTML = `已关注`
                        $(th).removeClass('layui-bg-blue')
                        $(th).addClass('layui-bg-orange')
                    } else {
                        $(th)[0].innerHTML = `+关注`
                        $(th).removeClass('layui-bg-orange')
                        $(th).addClass('layui-bg-blue')
                    }

                } else {
                    layer.msg(res.message, { icon: 5 })
                }
            }
                , 'json')
        }
        else {
            layer.confirm('请先登录再来操作哦！', () => {
                window.location.href = "{:url('/index/login/index')}"
            })
        }
    }
    function addFriend()
    {
        layer.msg('功能待开发...')
    }
    function sendMsg()
    {
        layer.msg('功能待开发...')
    }
</script>